﻿using System;
using System.Collections.Generic;
using GameName1.Annotations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace GameName1
{
    [UsedImplicitly]
    class Missile : Projectile
    {
        private static Texture2D _commonSprite;
        protected override Texture2D Sprite { get { return _commonSprite; } }
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Sprite, Position, Color.White);
        }

        public Missile(Vector2 position, int direction) : base(position)
        {
            Velocity = new Vector2(0,5) * direction;
        }
    
        public override void HandleHit(IHittable other,GameTime colissionTime)
        {
            GameObjectsManager.GetInstance().Destroy(this);
        }
        public override IEnumerable<Type> GetNotHittableTypes()
        {
            return new List<Type>{typeof(AngryAlien),typeof(PowerUpHealth)};
        }

        public static void LoadContent(ContentManager contentManager)
        {
            _commonSprite = contentManager.Load<Texture2D>("sprites/projectile_enemy");
        }
    }
}
